import Vue from "vue";
import VueRouter from "vue-router";
import Login from "../views/Login/index.vue";
// import home from "../common/Home.vue";
import notfound from "../views/404/index.vue";
import home from "../views/Home/home.vue";
import advertisement from "@/views/advertisement/index";
import ForgotPassword from "../views/Login/Reset.vue";
import AccountManagement from "../views/AccountManagement/index.vue";
import Applybrand from "../views/Applybrand/index.vue";
import community from "../views/community/index.vue";
import conversation from "../views/conversation/index.vue";
 
Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    name: "login",
    component: Login,
  },
  {
    path: "/ForgotPassword",
    component: ForgotPassword,
  },
  {
    path: "/",
    component: () => import("../common/Home.vue"),
    children: [
      {
        path: "/home",
        component: home,
      },
      {
        path: "/userManagement",
        component: () => import("@/views/userManagement/index"),
      },

      {
        path: "/taskManagement",
        component: () => import("@/views/taskManagement/index"),
      },
      {
        path: "/OrderManagement",
        component: () => import("@/views/OrderManagement/index"),
      },
      {
        path: "/scientificChild-rearing",
        component: () => import("@/views/scientificChild-rearing/index"),
      },

      {
        path: "/advertisement",
        component: advertisement,
      },
      {
        path: "/Brand-ambassador",
        component: AccountManagement,
      },
      {
        path: "/Applybrand",
        component: Applybrand,
      },
      {
        path: "/community",
        component: community,
      },
      {
        path: "/conversation",
        component: conversation,
      },
      {
        path: "/404",
        name: "404",
        component: notfound,
      },
      {
        path: "*",
        redirect: "/404",
      },
    ],
  },
];

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes,
});

export default router;
